package com.sanen.flyer.factory;

import com.sanen.flyer.entity.Bullet;
import com.sanen.flyer.entity.enemy.Enemy;
import com.sanen.flyer.entity.enemy.air1;
import com.sanen.flyer.entity.hero.Hero;
import com.sanen.flyer.entity.heroBullet.DaoDan;
import com.sanen.flyer.tool.ImageTool;

import java.awt.image.BufferedImage;

/**
 * 子弹工厂
 * @author wsse
 * @date 2018-09-07 11:02
 */
public class BulletFactory {
    public static final int DAO_DAN=1;
    public static BufferedImage daoDan;

    public static Bullet getBullet(Hero hero, int type,int x,int y){
        switch (type){
            case DAO_DAN:
                return new DaoDan(getDaoDan(),hero,x,y);
        }
        return null;
    }

    /**
     * 加载图片huanYing
     */
    private static synchronized BufferedImage getDaoDan() {
        if (daoDan==null)daoDan= ImageTool.getImage("./image/bullet/daoDan1.png");
        return daoDan;
    }
}
